草庐IT

c++: 捕获 runtime_error

全部标签

php - 下载 zip 文件 "Failed network error"(PHP/NGINX)

当我尝试从我的实时服务器下载zip文件时,我的浏览器(Chrome和Firefox)出现以下错误,https://mysite.com:失败的网络错误。令人困惑的是,在我的本地主机上使用来self的实时服务器的相同代码(如下)允许我成功下载相同的zip文件:$path=$data['path_new']='uploads/some-path/';$file_name='test.zip';$file=$path.$file_name;header("Content-Disposition:attachment;filename=".$file_name);header("Content

PHP/SQLite3 : Fatal error: Call to undefined function sqlite_num_rows()

当我调用函数sqlite_num_rows时出现此错误。它一定不是依赖性问题,因为其他Sqlite函数正在运行。我能够打开连接并从数据库获取数据。 最佳答案 晚了4年,但我遇到了同样的问题,所以这是我为遇到同样问题的任何人提供的解决方案//$dbisthedatabasehandle$result=$db->query("SELECT*FROMtable_name");$rows=0;//setrowcounterto0while($row=$result->fetchArray()){$rows+=1;//+1tothecount

php - 无法创建非静态方法 - fatal error

我正在开发一个PHP网络应用程序。我使用了来自gurrido.net的新数据网格,它在本地运行良好,但是当我将其上传到服务器时,出现以下错误:Fatalerror:CannotmakenonstaticmethodBase::getClassName()staticinclassSingletonsin/var/www/reskb/phpinc/Singletons.class.phponline84在我没有使用网格的旧版本中,我让它工作了。这是我的singletons.class.php文件代码:getClassName();$self->objects[$className]=$o

php - 如何在 Laravel 注销后捕获登录时间?

我正在使用Laravel5制作一个应用程序,我应该有一个模块来保存和更新用户的登录时间。我是编程新手,所以我对如何去做的逻辑很着迷。这适用于调用中心代理,他们的轮类时间是下午3点到早上6点因此,例如他们使用2015-07-2103:00:00的时间戳登录那是3pm然后如果他们在4pm注销他们有1.0的登录时间然后他们在7pm再次登录并登录在2015年7月21日凌晨5点离开,那将是他们之前的登录时间,即1.0+10.0因为7pm2015-07-20-2015年7月21日凌晨5点。并且应该更新该用户的登录时间。我该怎么做?所以现在我的数据库中有一个表是logihours->id->user

php - fatal error : Out of memory (allocated 1979711488) (tried to allocate 131072 bytes) error occur while writing xlsx file using phpexcel

我已经集成了xlsx文件,用于使用phpexcel从数据库写入。我想在xlsx文件中写入3,00,000条记录。但直到通过Fatalerror:Outofmemory(allocated1979711488)(triedtoallocate131072bytes)我的PHP版本5.3.28我还设置了phpini和单元格缓存,请参阅下面的代码ini_set('max_execution_time',-1);ini_set('memory_limit','-1');$cacheMethod=PHPExcel_CachedObjectStorageFactory::cache_in_memo

php - 捕获/抑制来自 php exec 的所有输出,包括 stderr

我想通过exec()运行多个命令,但我不想在屏幕上显示任何输出。但是,我确实希望保留输出,以便在脚本运行时控制冗长程度。这是我的类(class):问题是,大多数应用程序都会将大量不相关的内容放入stderr,我似乎无法阻止这些内容。例如,这是通过它运行gitclone的输出:Cloninginto'/tmp/directory'...remote:Countingobjects:649,done.remote:Compressingobjects:100%(119/119),done.remote:Total649(delta64),reused0(delta0),pack-reuse

php - Laravel 解析错误 : syntax error, unexpected T_CLASS, expecting T_STRING

我在今年8月开发了一个laravel应用程序,当时它运行良好。我现在正在尝试运行该应用程序,但它返回了这个错误:parseerror:syntaxerror,unexpectedT_CLASS,expectingT_STRINGorT_VARIABLEor'{'or'$'inD:\bkonme\artisanline31第31行是这样的:$kernel=$app->make(Illuminate\Contracts\Console\Kernel::class);我的PHP版本是5.6.14,我在windows平台上使用XAMPP。我有一些想法,因为laravel和PHP之间存在一些版本

php - 捕获最大执行时间php

我想创建一个可以捕捉最大执行时间的函数,我找到了这个函数。functionrunfunction($func,$args,$msgs){try{$t1=time();$result="";while(true){$time_2=time();$result=call_user_func_array($func,$args);if($result){return$result;}$time_spent=time()-$t1;$time_funcs=time()-$time_2;getThrow($time_spent,$time_funcs,$msgs);}}catch(Exceptio

javascript - 拉维尔 5.2 :How to show validation errors when submitting form with ajax?

我正在使用laravel5.2,我的问题是:使用ajax提交表单时如何显示验证错误?例如:不使用ajax时,如果title字段没有填写,提交的时候有信息:“标题字段是必需的。”以及,当使用ajax时,如何显示上面的信息。查看:Title:Content:Photo:SubmituploadsuccessfullyJavascript:$(function(){vararticleData=newFormData($('#formArticle')[0]);$(document).on('submit','#formArticle',function(e){e.preventDefaul

php - Symfony2 404 错误 : Object Not Found (ParamConverter error)

我创建了一个名为search.html.twig的新边界类,但是当我转到URL(http://localhost:8000/shrubs/search)时,出现以下错误:ERROR-UncaughtPHPExceptionSymfony\Component\HttpKernel\Exception\NotFoundHttpException:"AppBundle\Entity\Shrubsobjectnotfound."atC:\Users\rosmith\shrub_search\vendor\sensio\framework-extra-bundle\Request\ParamCo